home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
SCRNSCAN.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
2KB
|
86 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_ScreenScan( nLine, cText, nType, cChar ) --> xRetVal
PARAMETERS:
nLine : Screen Line to scan for text Default is Cursor Line
cText : Text to scan for (Required and CASE SENSITIVE!)
nType : Type of operation to perform
cChar : Delimiter character
SHORT:
Scan screen to locate or extract text.
DESCRIPTION:
_ScreenScan() operates in one of three ways. First, it can scan the screen
and attempt to locate spcified text and return logical TRUE or FALSE
indicating such. Second, it can, in lieu of a logical value, return the
row/col coordinates of the located text in an array. And thirdly, it can
extract the text in which the specified token was found.
nType Values:
1 - Scan and Return TRUE if text exists in specified coordinates or FALSE
otherwise. (DEFAULT)
2 - Scan and Return the row/col coordinates of the located text in an array.
3 - Extract the located text from the specified area, using cChar as
delimiter.
The Delimiter Character (cChar) is valid only with option 3 from the above.
The default delimiter is a SPACE.
NOTE:
EXAMPLE:
Line 5 of screen contains:
... "THE FILE NAME IS: S:\POWER\GLORY\FOREVER\AMEN.DAT" ...
Then:
#define K_TORF 1
#define K_POS 2
#define K_EXTRACT 3
_ScreenScan( 5, '\', K_EXTRACT, ' ')
This usage will return the file name with path from the screen by telling
the function to look for a backslash and extracting text using SPACE as
a delimiting char.
BEGIN OR END OF STRING ALWAYS = DELIMIT CHAR
Extract "HOWDY" delimited by SPACE. All three of the following would
work just fine:
" HOWDY " - All three of these are essentially equivelent as
" HOWDY" - far as extracting the text with a delimiter is
"HOWDY " - concerned.
In addition to scanning a particular screen line, you can also scan the
entire screen. Passing a value of -1 in nLine causes the function to scan
all lines for the given text stopping on the first occurance of a match.
In the above example,
_ScreenScan( -1, 'AMEN.DAT', K_POS)
would return an array with
Element[1] = 5
Element[2] = 42 (or wherever it happens to be)
******************************************************************************/